function main(defaultParams) {
    var self = this;

    api.EXEC_FORMULA("TREE_QUERY_CHILDRENS('0bd248ce-ec9f-461e-9e49-59bfb60d2063','" + defaultParams.unit_id + "',['unit_id'])").then((res) => {
        // then() 为调用成功的回调
        var rootPageElement = null;
        const findRootPage = (ele) => {
            if (ele.data && ele.data.name === "root") {
                rootPageElement = ele;
                return;
            }
            findRootPage(ele.$parent);
        }
        findRootPage(self);

        var tabEle = self.$$("tabs_6mvwh9");

        if (tabEle) {
            //设置指定索引的标签页是否可见，序号从1开始
            // tabEle.data.children[1].props.visible = false;

            //设置指定索引的标签页选中
            let currentTa = tabEle.params.currentTab


            let pageTableList = rootPageElement.state.getElement("page_widget_list_hjn6kq");
            if (currentTa === 1) {
                pageTableList = rootPageElement.state.getElement("page_widget_list_hjn6kq");
            } else{
                pageTableList = rootPageElement.state.getElement("page_widget_list_bxy7z3");
            }



            if (pageTableList && pageTableList.dataEngine && pageTableList.dataEngine.state) {
                let tableComp = pageTableList.dataEngine.state.getElement("table_791etl");

                let filed = ""
                if (currentTa === 1) {
                    tableComp = pageTableList.dataEngine.state.getElement("table_791etl");
                    filed = "2345c946-1f6f-4a18-b435-a3f2799d0cf7"
                } else {
                    tableComp = pageTableList.dataEngine.state.getElement("table_fd2tao");
                    filed = "322fe0b1-a4d2-4ad2-917c-31adc45f934b"
                }
                if (tableComp) {
                    var members = []
                    if (currentTa === 1) {
                        members = pageTableList.dataEngine.state.layout.props.dataSet.filterData.filter.members.slice(0, 1);
                    }

                    members.push({
                        field: filed,
                        fieldName: "work_unit_id",
                        "fieldType": "TYPE_INTEGER",
                        valueType: "Constant",
                        values: res.result || [],
                        value: "",
                        operate: "In", // 范围查询
                        className: "Single"
                    });
                    var filter = {
                        "combine": "And",
                        "className": "List",
                        "members": members
                    };

                    pageTableList.dataEngine.state.layout.props.dataSet.filterData = {
                        "enabled": true,
                        "filter": filter,
                        "filterType": "FILTER",
                        "rawCondition": {},
                        "rawFormula": ""
                    }



                    tableComp.onRefresh();
                }
            }

        }



    }).catch(err => {
        self.$message.error(err.message); // 显示错误提示信息
    });
}


